//
//  NSString+category.m
//  deerkids
//
//  Created by 王昭的Mac Air on 2017/8/31.
//  Copyright © 2017年 wangzhao. All rights reserved.
//

#import "NSString+category.h"

@implementation NSString (category)

#pragma mark - 属性文字段落格式设置
- (NSAttributedString *)formatWithParagraph:(CGFloat)lineSpaceing fontSize:(CGFloat)fontSize textColor:(UIColor *)textColor
{
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    paragraphStyle.lineSpacing = lineSpaceing;
    paragraphStyle.lineBreakMode = NSLineBreakByCharWrapping;
    NSDictionary *attrs = @{NSFontAttributeName:[UIFont systemFontOfSize:fontSize],
                            NSParagraphStyleAttributeName:paragraphStyle,
                            NSForegroundColorAttributeName:textColor
                            };
    return [[NSAttributedString alloc] initWithString:self attributes:attrs];
}

@end
